package com.parktech.sun.domain.repository.sunhz.hibernate;

import com.parktech.sun.domain.model.sunhz.Enterprise;
import com.parktech.sun.domain.model.sunhz.EnterpriseCategoryProduct;
import com.parktech.sun.domain.repository.hibernate.BaseRepositoryImpl;
import com.parktech.sun.domain.repository.sunhz.EnterpriseRepository;
import org.springframework.stereotype.Repository;

/**
 * User: Think
 * Date: 2010-12-28
 * Time: 2:47:20
 */
@Repository("enterpriseRepository")
public class EnterpriseRepositoryImpl extends BaseRepositoryImpl<Enterprise> implements EnterpriseRepository {

    public void saveOrUpdateCategoryProduct(EnterpriseCategoryProduct enterpriseCategoryProduct) {
        getSession().saveOrUpdate(enterpriseCategoryProduct);
    }

    public EnterpriseCategoryProduct getProductById(Long productId) {
        return (EnterpriseCategoryProduct) getSession().get(EnterpriseCategoryProduct.class, productId);
    }
}
